export function roleTableColumns() {
    return [
        {
            title: this.$t('module.userManage.roleId'),
            key: 'id'
        },
        {
            title: this.$t('module.userManage.roleName'),
            key: 'name'
        },
        {
            title: this.$t('common.operating'),
            fixed: 'right',
            align: 'center',
            render: (h, params) => {
                return h(
                    'RowTools',
                    {
                        props: {
                            data: [
                                {
                                    type: 'icon',
                                    icon: 'md-create',
                                    text: this.$t('common.edit'),
                                    handle: () => this.addOrEditRole(params.row)
                                },
                                {
                                    type: 'icon',
                                    icon: 'md-people',
                                    text: this.$t('module.userManage.userGroupAssign'),
                                    handle: () => this.assignPeople(params.row)
                                },
                                {
                                    type: 'icon',
                                    icon: 'ios-hammer',
                                    text: this.$t('module.userManage.menuSet'),
                                    handle: () => this.setMenu(params.row)
                                },
                                {
                                    type: 'icon',
                                    icon: 'logo-buffer',
                                    text: this.$t('module.userManage.assignResource'),
                                    handle: () => this.assignResource(params.row)
                                },
                                {
                                    type: 'icon',
                                    icon: 'ios-trash',
                                    text: this.$t('common.delete'),
                                    handle: () => this.deleteRole(params.row)
                                }
                            ]
                        }
                    }
                )
            }
        }
    ]
}

export function unchosedResCol() {
    return [
        {
            type: 'selection',
            width: 40
        },
        {
            title: this.$t('module.tenantManage.code'),
            key: 'resourceCode'
        },
        {
            title: this.$t('module.tenantManage.name'),
            key: 'resourceName'
        },
        {
            title: this.$t('module.tenantManage.requestUrl'),
            key: 'resourceUrl'
        }
    ]
}